﻿using Business;
using Business.Forms;
using Ecf.Dicionary;
using Ecf.Enum;

namespace Ecf.Forms
{
    public partial class FormCadastrarAliquota : FormDefault
    {
        public FormCadastrarAliquota()
        {
            InitializeComponent();
            InitFocusControl = cboTipoAliquota;
            tipoAliquotaDicionaryBindingSource.DataSource = new TipoAliquotaDicionary();
        }

        private void cmdCadastrar_Click(object sender, System.EventArgs e)
        {
            var tipo = (TipoAliquota) cboTipoAliquota.EditValue;
            EcfHelper.GetEcf().CadastrarAliquota(txtAliquota.Value,tipo);
        }

        private void cmdSair_Click(object sender, System.EventArgs e)
        {
            Close();
        }
    }
}
